import Vue from 'vue'
import router from '@/router/index.js'
Vue.directive('permission',{
	inserted:function(el,binding){
		console.log(el);
		console.log(binding.value.action);
		var action = binding.value.action
		var effect = binding.value.effect
		console.log(router.currentRoute.meta);
		if(router.currentRoute.meta.indexOf(action) === -1){
			if(effect === "disabled"){
				el.disabled = true
				el.classList.add('is-disabled')
			}else {
				el.parentNode.removeChild(el)
			}
		}
	}
}) 
